package com.hqj.demo.service;

import com.hqj.demo.dao.MemberDao;
import com.hqj.demo.entity.Teacher;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;

public class MemberServiceI1 implements MemberService{
    @Autowired
    private MemberDao md;

    @Override
    public List<Teacher> findTeacher(String param) {

        List<Teacher> list = new ArrayList<>();
        List<Teacher> allList = md.findMember();

        for(Teacher t:allList){
            if(param.equals(t.getName())){
                list.add(t);
            }
        }

        return list;
    }
}
